<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<style>
    .ipt {
        width: 200px;
        height: 20px;
        outline-style: none;
    }
</style>

<body>
    <progress value="0" max="100" id="pro"></progress>
    <input type="text" class="ipt">
</body>
<script src="./24.throttle.js"></script>
<script>
    const ipt = document.querySelector('.ipt')
    ipt.oninput = throttle(function () {
        // console.log(this);
        console.log(this.value);
    }, 1000)

    const progress = document.querySelector('#pro')
    time = setInterval(() => {
        progress.value += 2
        console.log(progress.value);
        if (progress.value == 100) {
            clearInterval(time)
            time = null
        }
    }, 20)

</script>

</html>